package demo2inter;

public interface ITestInterFace {
    public static final int a=100;
    int AGE=10;

    void draw();
/*
    abstract public void fun1();
    void fun2();
*/


/*    default void func(){
        System.out.println("default!");
    }
    public static void staticFunc(){
        System.out.println("staticFunc!");
    }*/
}
class Rect implements ITestInterFace{
    @Override
    public void draw() {
        System.out.println("画一个矩形！");
    }
}
class Triangle implements ITestInterFace{
    @Override
    public void draw() {
        System.out.println("画一个三角形！");
    }
}
class Test{
    public static void drawMap(ITestInterFace iTestInterFace){
        iTestInterFace.draw();
    }
    public static void main(String[] args) {
        drawMap(new Rect());//发生了向上转型和动态绑定
        drawMap(new Triangle());
    }
}
